Restrict the width of the popup to be no larger than the monitor.
authorMatthias Clasen <mclasen@redhat.com>
Tue, 18 May 2004 18:31:54 +0000 (18:31 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 18 May 2004 18:31:54 +0000 (18:31 +0000)
2004-05-18  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup):
Restrict the width of the popup to be no larger than the
monitor.  (#142678, DmD Ljungmark)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkentrycompletion.c

index 6191420fa5d35868d049dcc2aa54a6f661d1233b..514ae5d9600278be545862635755e8b73af847f9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2004-05-18  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): 
+       Restrict the width of the popup to be no larger than the
+       monitor.  (#142678, DmD Ljungmark)
+
+       * gtk/gtkbutton.c: Go back to the initial fix for the 
+       focus-overdrawing problem, which was actually correct 
+       according to docs/widget_geometry.txt.
+
+       * gtk/gtkarrow.c (gtk_arrow_class_init): Bump the initial
+       arrow size from 11 to 15 to compensate for that.
+
        * gtk/gtktextview.c (gtk_text_view_class_init): Document the
        arguments of the ::move-cursor signal.  (#142725)
 
index 6191420fa5d35868d049dcc2aa54a6f661d1233b..514ae5d9600278be545862635755e8b73af847f9 100644 (file)
@@ -1,5 +1,16 @@
 2004-05-18  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): 
+       Restrict the width of the popup to be no larger than the
+       monitor.  (#142678, DmD Ljungmark)
+
+       * gtk/gtkbutton.c: Go back to the initial fix for the 
+       focus-overdrawing problem, which was actually correct 
+       according to docs/widget_geometry.txt.
+
+       * gtk/gtkarrow.c (gtk_arrow_class_init): Bump the initial
+       arrow size from 11 to 15 to compensate for that.
+
        * gtk/gtktextview.c (gtk_text_view_class_init): Document the
        arguments of the ::move-cursor signal.  (#142725)
 
index 6191420fa5d35868d049dcc2aa54a6f661d1233b..514ae5d9600278be545862635755e8b73af847f9 100644 (file)
@@ -1,5 +1,16 @@
 2004-05-18  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): 
+       Restrict the width of the popup to be no larger than the
+       monitor.  (#142678, DmD Ljungmark)
+
+       * gtk/gtkbutton.c: Go back to the initial fix for the 
+       focus-overdrawing problem, which was actually correct 
+       according to docs/widget_geometry.txt.
+
+       * gtk/gtkarrow.c (gtk_arrow_class_init): Bump the initial
+       arrow size from 11 to 15 to compensate for that.
+
        * gtk/gtktextview.c (gtk_text_view_class_init): Document the
        arguments of the ::move-cursor signal.  (#142725)
 
index 6191420fa5d35868d049dcc2aa54a6f661d1233b..514ae5d9600278be545862635755e8b73af847f9 100644 (file)
@@ -1,5 +1,16 @@
 2004-05-18  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): 
+       Restrict the width of the popup to be no larger than the
+       monitor.  (#142678, DmD Ljungmark)
+
+       * gtk/gtkbutton.c: Go back to the initial fix for the 
+       focus-overdrawing problem, which was actually correct 
+       according to docs/widget_geometry.txt.
+
+       * gtk/gtkarrow.c (gtk_arrow_class_init): Bump the initial
+       arrow size from 11 to 15 to compensate for that.
+
        * gtk/gtktextview.c (gtk_text_view_class_init): Document the
        arguments of the ::move-cursor signal.  (#142725)
 
index 1d1ab74ea191822ac5b85c8baff06ec122dfea98..d7cd492b92985015e8901c4ac3a8d53e85968cf4 100644 (file)
@@ -1091,7 +1091,8 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
   GtkRequisition popup_req;
   GtkTreePath *path;
   gboolean above;
-
+  gint width;
+  
   gdk_window_get_origin (completion->priv->entry->window, &x, &y);
   get_borders (GTK_ENTRY (completion->priv->entry), &x_border, &y_border);
 
@@ -1110,9 +1111,14 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
   else
     gtk_widget_show (completion->priv->scrolled_window);
 
+  screen = gtk_widget_get_screen (GTK_WIDGET (completion->priv->entry));
+  monitor_num = gdk_screen_get_monitor_at_window (screen, 
+                                                 GTK_WIDGET (completion->priv->entry)->window);
+  gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
+
+  width = MIN (completion->priv->entry->allocation.width, monitor.width);
   gtk_widget_set_size_request (completion->priv->tree_view,
-                               completion->priv->entry->allocation.width - 2 * x_border,
-                               items * height);
+                               width - 2 * x_border, items * height);
 
   /* default on no match */
   completion->priv->current_selected = -1;
@@ -1128,18 +1134,12 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
                                           &height);
 
       gtk_widget_set_size_request (completion->priv->action_view,
-                                   completion->priv->entry->allocation.width - 2 * x_border,
-                                   items * height);
+                                   width - 2 * x_border, items * height);
     }
   else
     gtk_widget_hide (completion->priv->action_view);
 
   gtk_widget_size_request (completion->priv->popup_window, &popup_req);
-
-  screen = gtk_widget_get_screen (GTK_WIDGET (completion->priv->entry));
-  monitor_num = gdk_screen_get_monitor_at_window (screen, 
-                                                 GTK_WIDGET (completion->priv->entry)->window);
-  gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
   
   if (x < monitor.x)
     x = monitor.x;